package jk.fox.node.rule;

import jk.fox.node.node.RpcNode;

import java.util.List;

/**
 * @Auther cuichao
 * @Description: SingleRule
 * @Date: create in 2020/4/20 14:20
 */
public class SingleRule implements IRule<RpcNode> {

    @Override
    public String rule(RpcNode node) {
        List<String> uriList = node.getUriList();
        if(uriList == null || uriList.isEmpty() || uriList.size() != 1 )
            return null;
        return uriList.get(0);
    }


    @Override
    public String getName() {
        return "single";
    }
}
